import axios from "axios";
const BASE_URL = import.meta.env.VITE_BASE_URL;

export const uploadFile = (Form, file, token, callBack) => {
  const { uid, file_type, use_type } = Form;
  return axios({
    url: BASE_URL + "api/upload/file" + `?uid=${uid}&file_type=${file_type}&use_type=${use_type}`,
    method: "POST",
    headers: { Authorization: `Bearer ${token}` },
    data: file,
    timeout: 10000000,
    onUploadProgress: callBack
  });
};
